Analyzing samples representative of downhole fluids is an important aspect of determining the quality and economic value of a hydrocarbon formation.
Present day operations obtain an analysis of downhole fluids usually through wireline logging using a formation tester such as the MDT™ tool of Schlumberger Oilfield Services. However, more recently, it was suggested to analyze downhole fluids either through sensors permanently or quasi-permanently installed in a wellbore or through sensor mounted on the drillstring. The latter method, if successfully implemented, has the advantage of obtaining data while drilling, whereas the former installation could be part of a control system for wellbores and hydrocarbon production therefrom.
To obtain an estimate of the composition of downhole fluids, the MDT tools uses an optical probe to estimate the amount of hydrocarbons in the samples collected from the formation. Other sensors use resistivity measurements to discern various components of the formations fluids.
Particularly, knowledge of downhole formation (produced) water chemistry is needed to save costs and increase production at all stages of oil and gas exploration and production. Knowledge of particularly the water chemistry is important for a number of key processes of the hydrocarbon production, including:                Prediction and assessment of mineral scale and corrosion;        Strategy for oil/water separation and water re-injection;        Understanding of reservoir compartmentalization/flow units;        Characterization of water break-through;        Derivation of the water cut Rw; and        Evaluation of downhole the H2S partition the oil and or water (if used for H2S measurements).        
Some chemical species dissolved in water (like, for example, Cl− and Na+) do not change their concentration when removed to the surface either as a part of a flow through a well, or as a sample taken downhole. Consequently information about their quantities may be obtained from downhole samples and in some cases surface samples of a flow. However, the state of chemical species, such as H+ (pH=−log[concentration of H+]), CO2, or H2S may change significantly while tripping to the surface. The change occurs mainly due to a difference in temperature and pressure between downhole and surface environment. In case of sampling, this change may also happen due to degassing of a sample (seal failure), mineral precipitation in a sampling bottle, and (especially in case of H2S)— a chemical reaction with the sampling chamber. It should be stressed that pH, H2S, or CO2 are among the most critical parameters for corrosion and scale assessment. Consequently it is of considerable importance to have their downhole values precisely known.
The concentration of protons or its logarithm pH can be regarded as the most critical parameter in water chemistry. It determines the rate of many important chemical reactions as well as the solubility of chemical compounds in water, and (by extension) in hydrocarbon.
Hence, there is and will continue to be a demand for downhole chemical measurements. However, no downhole chemical measurements actually performed in an oil and gas producing well have been reported so far, though many different methods and tools have been proposed in the relevant literature.
General downhole measurement tools for oilfield applications are known as such. Examples of such tools are found in the U.S. Pat. Nos. 6,023,340; 5,517,024; and 5,351,532 or in the International Patent Application WO 99/00575. An example of a probe for potentiometric measurements of ground water reservoirs is further published as: Solodov, I. N., Velichkin, V. I., Zotov, A. V. et al. “Distribution and Geochemistry of Contaminated Subsurface Waters in Fissured Volcanogenic Bed Rocks of the Lake Karachai Area, Chelyabinsk, Southern Urals” in: Lawrence Berkeley Laboratory Report 36780/UC-603(1994b), RAC-6, Ca, USA.
The known state of the art in the field of high temperature potentiometric measurements and tool is described for example in the published UK patent application GB-2362469 A.
A number of chemical analysis tools are known from chemical laboratory practice. Such known analysis tools include for example the various types of chromatography, electrochemical and spectral analysis. Particularly, the potentiometric method has been widely used for the measurements of water composition (pH, Eh, H2S, CO2, Na+, Cl− etc.) both in the laboratory and in the field of ground water quality control. U.S. Pat. No. 5,223,117 discloses a two-terminal voltammetric microsensor having an internal reference using molecular self-assembling to form a system in which the reference electrode and the indicator electrode are both on the sensor electrode. The reference molecule is described as a redox system that is pH-insensitive, while the indicator molecule is formed by a hydro-quinone based redox system having a potential that shifts with the pH. Both, reference molecule and indicator molecule layers are prepared by self-assembly on gold (Au) microelectrodes. In the known microsensor, a pH reading is derived from peak readings of the voltagrams.
The laboratory systems, however, are often not suitable for wellbore application with demands for ruggedness, stability and low maintenance and energy consumption being rarely met.
It is therefore an object of the present invention to provide apparatus and methods to perform electrochemical measurements in hydrocarbon wells during drilling and production. More specifically, it is an object of the present invention to provide robust sensors for molecularly selective electro-chemical measurements, in particular pH measurements.